﻿namespace Framework.UI.TestHarness.Models
{
    using System;
    using System.Collections.Generic;
    using Framework.ComponentModel;

    /// <summary>
    /// The person collection.
    /// </summary>
    public sealed class PersonCollection : ObservableItemsCollection<Person>
    {
        private List<string> professions = new List<string>()
        {      
            "Academics", 
            "Accountants",
            "Actuaries",
            "Architects",
            "Audiologist",
            "Clergymen",
            "Dentists",
            "Economists",
            "Engineers",
            "Language professionals",
            "Lawyers",
            "Librarians",
            "Nurses",
            "Pharmacists",
            "Physicians",
            "Physiotherapists",
            "Psychologists",
            "Professional Pilots",
            "Scientists",
            "Social workers",
            "Speech-Language Pathologist",
            "Statisticians",
            "Surgeons",
            "Surveyors",
            "Teachers",
            "Urban Planners"
        };
        private List<string> eyeColours = new List<string>()
        {
            "Blue",
            "Brown",
            "Gray",
            "Green",
            "Red"
        };
        private List<string> genders = new List<string>()
        {
            "Male",
            "Female"
        };
        private List<string> countries = new List<string>()
        {
            "Afghanistan",
            "Albania",
            "Algeria",
            "Andorra",
            "Angola",
            "Antigua & Deps",
            "Argentina",
            "Armenia",
            "Australia",
            "Austria",
            "Azerbaijan",
            "Bahamas",
            "Bahrain",
            "Bangladesh",
            "Barbados",
            "Belarus",
            "Belgium",
            "Belize",
            "Benin",
            "Bhutan",
            "Bolivia",
            "Bosnia Herzegovina",
            "Botswana",
            "Brazil",
            "Brunei",
            "Bulgaria",
            "Burkina",
            "Burundi",
            "Cambodia",
            "Cameroon",
            "Canada",
            "Cape Verde",
            "Central African Rep",
            "Chad",
            "Chile",
            "China",
            "Colombia",
            "Comoros",
            "Congo",
            "Congo",
            "Costa Rica",
            "Croatia",
            "Cuba",
            "Cyprus",
            "Czech Republic",
            "Denmark",
            "Djibouti",
            "Dominica",
            "Dominican Republic",
            "East Timor",
            "Ecuador",
            "Egypt",
            "El Salvador",
            "Equatorial Guinea",
            "Eritrea",
            "Estonia",
            "Ethiopia",
            "Fiji",
            "Finland",
            "France",
            "Gabon",
            "Gambia",
            "Georgia",
            "Germany",
            "Ghana",
            "Greece",
            "Grenada",
            "Guatemala",
            "Guinea",
            "Guinea-Bissau",
            "Guyana",
            "Haiti",
            "Honduras",
            "Hungary",
            "Iceland",
            "India",
            "Indonesia",
            "Iran",
            "Iraq",
            "Ireland",
            "Italy",
            "Ivory Coast",
            "Jamaica",
            "Japan",
            "Jordan",
            "Kazakhstan",
            "Kenya",
            "Kiribati",
            "Korea North",
            "Korea South",
            "Kosovo",
            "Kuwait",
            "Kyrgyzstan",
            "Laos",
            "Latvia",
            "Lebanon",
            "Lesotho",
            "Liberia",
            "Libya",
            "Liechtenstein",
            "Lithuania",
            "Luxembourg",
            "Macedonia",
            "Madagascar",
            "Malawi",
            "Malaysia",
            "Maldives",
            "Mali",
            "Malta",
            "Marshall Islands",
            "Mauritania",
            "Mauritius",
            "Mexico",
            "Micronesia",
            "Moldova",
            "Monaco",
            "Mongolia",
            "Montenegro",
            "Morocco",
            "Mozambique",
            "Myanmar",
            "Namibia",
            "Nauru",
            "Nepal",
            "Netherlands",
            "New Zealand",
            "Nicaragua",
            "Niger",
            "Nigeria",
            "Norway",
            "Oman",
            "Pakistan",
            "Palau",
            "Panama",
            "Papua New Guinea",
            "Paraguay",
            "Peru",
            "Philippines",
            "Poland",
            "Portugal",
            "Qatar",
            "Romania",
            "Russian Federation",
            "Rwanda",
            "St Kitts & Nevis",
            "St Lucia",
            "Saint Vincent & the Grenadines",
            "Samoa",
            "San Marino",
            "Sao Tome & Principe",
            "Saudi Arabia",
            "Senegal",
            "Serbia",
            "Seychelles",
            "Sierra Leone",
            "Singapore",
            "Slovakia",
            "Slovenia",
            "Solomon Islands",
            "Somalia",
            "South Africa",
            "South Sudan",
            "Spain",
            "Sri Lanka",
            "Sudan",
            "Suriname",
            "Swaziland",
            "Sweden",
            "Switzerland",
            "Syria",
            "Taiwan",
            "Tajikistan",
            "Tanzania",
            "Thailand",
            "Togo",
            "Tonga",
            "Trinidad & Tobago",
            "Tunisia",
            "Turkey",
            "Turkmenistan",
            "Tuvalu",
            "Uganda",
            "Ukraine",
            "United Arab Emirates",
            "United Kingdom",
            "United States",
            "Uruguay",
            "Uzbekistan",
            "Vanuatu",
            "Vatican City",
            "Venezuela",
            "Vietnam",
            "Yemen",
            "Zambia",
            "Zimbabwe"
        };
        private Random random = new Random();

        /// <summary>
        /// Initialises a new instance of the <see cref="PersonCollection"/> class.
        /// </summary>
        public PersonCollection()
            : this(100)
        {
        }

        /// <summary>
        /// Initialises a new instance of the <see cref="PersonCollection" /> class.
        /// </summary>
        /// <param name="number">The number of people to create.</param>
        public PersonCollection(int number)
        {
            for (int i = 0; i < number; ++i)
            {
                this.Add(
                    new Person()
                    {
                        EyeColour = this.random.ChooseItem(this.eyeColours),
                        Gender = this.random.ChooseItem(this.genders),
                        Nationality = this.random.ChooseItem(this.countries),
                        Profession = this.random.ChooseItem(this.professions)
                    });
            }
        }
    }
}
